﻿@using Web.ViewModels
@model CatalogProduces
@{
    ViewBag.Title = "Товары по категориям";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="../../Scripts/DropdownlistEvents.js"></script>
<script src="../../Scripts/AddtoCart.js"></script>
<link href="../../Content/jquery.jgrowl.css" rel="stylesheet" />
<script src="../../Scripts/jquery.jgrowl.js"></script>
<style type="text/css">
    

    	div.jGrowl div.red_theme {
    	    background-color: #FE8200;
			border-radius: 5px;
            color: black;
            font: 900 14px Tahoma;
			margin-bottom: 5px;
			margin-top: 25px;
    	    height: 50px;
			padding: 10px 5px;
			text-align: left;
			width: 235px;
    	    opacity: 1;
			}




</style>




<div id="catalog">
    <div id="Name_catalog">@Model.Name</div>
    <form action="#">
        <table id="browse">
            @foreach (ItemsForSale item in Model.Items)
            {
               
                <tr>
                    <td class="name_tea">@item.Name</td>
                    <td></td>
                </tr>
                <tr>
                    <td class="about_tea">
                        @item.About
                    </td>
                    <td>
                        <div>
                            @if (item.ProductArtUrl != null)
                            {
                                <img src="@Url.Content(item.ProductArtUrl)"/>
                            }
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table class="option">
                            <tr>
                                <td>Категория</td>
                                <td class="none">@item.Category</td>
                            </tr>
                            <tr>
                                <td>Производитель</td>
                                <td class="none">@item.Producer</td>
                            </tr>
                            <tr>
                                <td>Цена в гривнах</td>
                                <td id="prod-price-@item.ProduceId" class="none">@item.Price</td>
                            </tr>
                            <tr>
                                <td>Упаковка (г)</td>

                                <td  class="none">@Html.DropDownListFor(
                                                     x => x.Items,
                                                     new SelectList(item.Packages, "Id", "Weight"),
                                                     new { @class = "dropDown" , storeId=item.Id, prodId= item.ProduceId}
                                                      )
                                </td>
                            </tr>
                        </table>
                        @if (item != Model.Items.Last())
                        {
                            <hr />
                        }     
                    </td>
                    <td>
                        
                        <div id="button">
                            <span id="pr-buy-@item.ProduceId">
                                @Html.ActionLink("Заказать", "AddToCart",
                                    "ShoppingCart", new { id = @item.Id}, new { @class = "addlick"})
                            </span>
                        </div>
                    </td>
                </tr>
            }
        </table>
    </form>
</div>
<!--catalog-->
